<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.2.1.min.js"></script>
</head>
<body>
<script>
$(function () {
    for (var i = 0; i < 5; i++) {
        var div = document.createElement('div');
        div.style.width = '200px';
        div.style.height = '200px';
        div.style.margin = '10px';
        div.style.background = 'red';
        div.style.float = 'left';
        document.body.appendChild(div);

    }
    $('div').click(function () {
        $(this).hide(500);
    })
})
</script>
</body>
</html>